// 检查游览器
export const inBrowser = typeof window !== 'undefined'
export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
export const isIE = UA && /msie|trident/.test(UA)
export const isIE9 = UA && UA.indexOf('msie 9.0') > 0
export const isEdge = UA && UA.indexOf('edge/') > 0
export const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge
export const isFF = UA && UA.match(/firefox\/(\d+)/)
export const isWX = UA && UA.indexOf('micromessenger') > 0

// 检查操作系统
export const isMac = UA && UA.indexOf('macintosh') > 0
export const isAndroid = UA && UA.indexOf('android') > 0
export const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA)
export const isWin32 = UA && /win32|wow32/.test(UA)
export const isWin64 = UA && /win64|wow64/.test(UA)
